package com.hmall.cart.controller.inner;

import com.hmall.api.cart.po.OrderList;
import com.hmall.cart.service.ICartService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 购物车相关内部接口
 *
 * @author Zhy
 * @version 1.0
 * @date 2025-03-18 16:38
 */
@Api(tags = "购物车相关接口")
@Slf4j
@RestController
@RequestMapping("/inner/carts")
@RequiredArgsConstructor
public class CartInnerController {

	private final ICartService cartService;

	@ApiOperation("批量删除购物车中商品")
	@ApiImplicitParam(name = "ids", value = "购物车条目id集合")
	@DeleteMapping
	public void deleteCartItemByUserIdAndIds(@RequestParam("userId") Long userId, @RequestParam("ids") List<Long> ids) {
		cartService.removeByItemIds(userId, ids);
	}

}
